﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AsyncCamera.Camera;
using AsyncCamera.Camera.media;

namespace Incendios0_1.Camera.wpfdatamanager
{
    public abstract class AbstractCamera
    {
        public CameraData cameraData;
        public MediaGroup media;

        public int Width;
        public int Height;
        public bool detectedFire;

        public AbstractCamera(CameraData cameraData)
        {
            this.cameraData = cameraData;
            detectedFire = false;
        }

        public virtual void Start()
        {
            media.Start();
        }

        public virtual void Stop()
        {
            media.Stop();
        }

        public virtual void Pause()
        {
            media.Pause();
        }

        public virtual void PlugIn(MediaSink sink)
        {
            media.PlugIn(sink);
        }

        public abstract void Reset();

        public override string ToString()
        {
            if (cameraData != null)
                return "Camara " + cameraData.HWControlAddress.ToString();
            else
                return "Camara no identificada";
        }

        public void resetDetection()
        {
            detectedFire = false;
        }
    }
}
